<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp"%>

<!DOCTYPE html>
<html>
<head>
    <title><spring:message code="message.list.DingDanQueRenMingXi"/></title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp"%>
    <style type="text/css">
        div.group-info {
            margin-top: 10px !important;
            margin-bottom: 0px !important;
        }
        input.innerInput {
            width: 98%;
        }
        .text-left{
            color:#949494;
        }
    </style>
</head>
<body class="skin-blue sidebar-mini fixed skin-blue-light-frame">
    <section class="content" >
        <form id="form" class="form-horizontal"  method="post">
            <input type="hidden" name=orderPackId value="${orderPackId}" />  
      <table class="infoBox" style="margin-top:5px">
      <tr>
        <td width="150px" class="infoBoxleft" style="background:url(${ctx}/lib/img/img.png)  no-repeat 40px 12px;">
       
        </td>
        <td>
          <form id="form" class="form-horizontal"  method="post">
                <div class="box-body" style="background:url(${ctx}/lib/img/infobg.png)  no-repeat right bottom;" >   
                  <div class="form-group form-group-xs"  style="margin-top:0px;">
                    <label class="col-sm-2 text-right" for="inputTextAlter1"><spring:message code="message.listForm.DingDanBaoHao"/><spring:message code="message.yanZheng.maoHao"/></label>
                    <div class="col-sm-3 text-left">${orderPackId}</div>
                      <label class="col-sm-2 text-right" for="inputTextAlter2"><spring:message code="message.lable.yiLiaoJiGouMingCheng"/><spring:message code="message.yanZheng.maoHao"/></label>
                     <div class="col-sm-3 text-left" id="hospName">${orderPack.hospName}</div>
                  </div>  
                  <div class="form-group form-group-xs"  style="margin-top:-15px;">
                    <label class="col-sm-2 text-right" for="inputTextAlter1"><spring:message code="message.listForm.YiLiaoJiGouDiQu"/><spring:message code="message.yanZheng.maoHao"/></label>
                    <div class="col-sm-3 text-left" id="areaName">${orderPack.hospArFullname}</div>
                    <label class="col-sm-2 text-right" for="inputTextAlter2"><spring:message code="message.listForm.CaiGouShiJian"/><spring:message code="message.yanZheng.maoHao"/></label>
                    <div class="col-sm-3 text-left" id="submitDateTime">${orderPack.submitDatetime}</div>
                  </div>
                  <div class="form-group form-group-xs"  style="margin-top:-15px;">
                    <label class="col-sm-2 text-right" for="recpUser"><spring:message code="message.listForm.ShouHuoRen"/><spring:message code="message.yanZheng.maoHao"/></label>
                    <div class="col-sm-3 text-left" id="recpUser">${orderPack.recpUser}</div>
                    <label class="col-sm-2 text-right" for="recpUserPhone"><spring:message code="message.lable.ShouHuoRenDianHua"/><spring:message code="message.yanZheng.maoHao"/></label>
                    <div class="col-sm-3 text-left" id="recpUserPhone">${orderPack.recpUserphone}</div>
                  </div>  
                  <div class="form-group form-group-xs" style="margin-top:-15px;margin-bottom:0px;">                    
                      <label class="col-sm-2 text-right" for="recpAddr" ><spring:message code="message.listForm.ShouHuoDiZhi"/><spring:message code="message.yanZheng.maoHao"/></label>
                      <div class="col-sm-9 text-left" id="recpAddr">${orderPack.recpAddr}</div>
                 </div>
             </div>
             </form>
        </td>
      </tr>
      </table>
            
                      
	  <!-- <div class="box box-success" style="margin-bottom: 0px;padding-bottom: 10px;">
	           <div class="form-group form-group-xs group-info">
	                 <label for="inputTextAlter1" class="col-sm-2 text-right"><spring:message code="message.listForm.DingDanBaoHao"/><spring:message code="message.yanZheng.maoHao"/></label>
	                 <div class="col-sm-4 text-left" >${orderPackId}</div>
	                 <label for="inputTextAlter2" class="col-sm-2 text-right"><spring:message code="message.lable.yiLiaoJiGouMingCheng"/><spring:message code="message.yanZheng.maoHao"/></label>
	                 <div id="hospName" class="col-sm-4 text-left">${orderPack.hospName}</div>
	            </div>
	             
	            <div class="form-group form-group-xs group-info">
	                 <label for="inputTextAlter1" class="col-sm-2 text-right"><spring:message code="message.listForm.YiLiaoJiGouDiQu"/><spring:message code="message.yanZheng.maoHao"/></label>
	                 <div id="areaName" class="col-sm-4 text-left">${orderPack.hospArFullname}</div>
	                 <label for="inputTextAlter2" class="col-sm-2 text-right"><spring:message code="message.listForm.CaiGouShiJian"/><spring:message code="message.yanZheng.maoHao"/></label>
	                 <div id="submitDateTime" class="col-sm-4 text-left">${orderPack.submitDatetime}</div>
	            </div>
	            
	            <div class="form-group form-group-xs group-info">
                     <label for="recpUser" class="col-sm-2 text-right"><spring:message code="message.listForm.ShouHuoRen"/><spring:message code="message.yanZheng.maoHao"/></label>
                     <div id="recpUser" class="col-sm-4 text-left">${orderPack.recpUser}</div>
                     <label for="recpUserPhone" class="col-sm-2 text-right"><spring:message code="message.lable.ShouHuoRenDianHua"/><spring:message code="message.yanZheng.maoHao"/></label>
                     <div id="recpUserPhone" class="col-sm-4 text-left">${orderPack.recpUserphone}</div>
                </div> 
                
                <div class="form-group form-group-xs group-info">
                     <label for="recpAddr" class="col-sm-2 text-right"><spring:message code="message.listForm.ShouHuoDiZhi"/><spring:message code="message.yanZheng.maoHao"/></label>
                     <div id="recpAddr" class="col-sm-10 text-left">${orderPack.recpAddr}</div>
                </div> 
	        </div>-->
        </form>

        <div class=" box box-success">
            <div class="box-body">
            	<div class="input">
		    		<div class="textalign1"><spring:message code="message.listForm.tongYongMing"/><spring:message code="message.yanZheng.maoHao"/></div>
                    <div class="boxinput">
                        <input type="text" class="textinput" id="drugName" name="drugName" placeholder="<spring:message code="message.listForm.tongYongMing"/>/<spring:message code="message.listForm.pinYinMa"/>" />
                    </div>
                    <div class="textalign1" style="display: none"><spring:message code="message.listForm.yaoPinBianMa"/><spring:message code="message.yanZheng.maoHao"/></div>
                    <div class="boxinput" style="display: none">
                        <input type="text" class="textinput" id="drugCode" name="drugCode"  placeholder="<spring:message code="message.listForm.yaoPinBianMa"/>" />
                    </div>
                    <div class="textalign1"><spring:message code="message.listForm.ShengChanQiYe"/><spring:message code="message.yanZheng.maoHao"/></div>
                    <div class="boxinput">
                         <input type="text" class="textinput" id="prodComp" name="prodComp"  placeholder="<spring:message code="message.listForm.ShengChanQiYe"/>/<spring:message code="message.listForm.pinYinMa"/>" />
                    </div>
					<div class="textalign1" >                    
                    <button type="button" onclick="gridSerch();" class="btn btn-success btn-sm"  id="selectDicCompType"><spring:message code="message.button.seachSpacing"/></button>
                    </div>
                </div>
            </div>
        </div>
        
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>
   </section>
    
   <%@ include file="/WEB-INF/component/commonJS.jsp"%>
   <script type="text/javascript">
   
   $(function () {
	   //绑定回车
	   $('#drugName,#drugCode,#prodComp').bind('keydown', function(event) {
	       if (event.keyCode == "13") {
	           $('#selectDicCompType').click();
	       }
	   });  
	   
	   $("#drugName").focus();//加载页面光标在第一个查询框内
	   
       $("#gridlist").jqGrid({
           url: "${ctx}/orderConfirm/getOrderConfirmDetail.html",
           mtype: "POST",
           postData:{"orderPackId":"${orderPackId}"},
           datatype: "json",
           autowidth: true,
           shrinkToFit: false,
           height: 260,
           colNames: [
              '<spring:message code="message.listForm.CaiGouJia"/>',
	          '<spring:message code="message.listForm.CaiGouShuLiang"/>',
	          '<spring:message code="message.listForm.CaiGouJinE"/>',
	          '<spring:message code="message.listForm.yaoPinBianMa"/>',
              '<spring:message code="message.listForm.tongYongMing"/>', 
              '<spring:message code="message.listForm.jiXing"/>',
              '<spring:message code="message.listForm.guiGe"/>',
              '<spring:message code="message.listForm.zhuanHuanXiShu"/>',
              '<spring:message code="message.listForm.baoZhuangDanWei"/>', 
              '<spring:message code="message.listForm.caiZhi"/>',
              '<spring:message code="message.listForm.shengChanQiYe"/>',
              '国药准字',
              '<spring:message code="message.listForm.CaiGouXianJia"/>',
	          '最高零售限价'
           ],
           colModel: [
               { name: 'proPrice', width: 80, align: "right",sortable:false,
            	   formatter:function(cellvalue, options, row){
                       return formatAmount(cellvalue, options, row);
                   }
               },
               { name: 'proCount', width: 80, align: "center",sortable:false},
               { name: 'orderMoney', width: 80, align: "right",sortable:false,
            	   formatter:function(cellvalue, options, row){
                       return formatAmount(cellvalue, options, row);
                   }
               },
               { name: 'drugCode', width: 120,hidden:true, align: "center",sortable:false,
                   formatter:function(cellvalue, options, row){
                       // return drugInfoLink(cellvalue);
                       return cellvalue;
                   }
               },
               { name: 'drugName', width: 160, align: "center" ,sortable:false },
               { name: 'formName', width: 80 , align: "center",sortable:false},
               { name: 'specName', width: 80, align: "center" ,sortable:false},
               { name: 'factor', width: 70, align: "center" ,sortable:false},
               { name: 'unitName', width: 60, align: "center" ,sortable:false},
               { name: 'materialName',hidden:true, width: 60,hidden:true, align: "center" ,sortable:false},
               { name: 'prodCompname', width: 250, align: "center",sortable:false,
            	   
                   formatter:function(cellvalue, options, row){
                       // return compInfoLink(row.prodCompcode, cellvalue, 1);
                       return cellvalue;
                   }
               },
               { name: 'drugMedicine', width: 80, align: "center",sortable:false},
               { name: 'proPriceLimit', width: 80,hidden:true,align:"right",sortable:false,
                   formatter:function(cellvalue, options, row){
                       return formatAmount(cellvalue, options, row);
                   }
               },
               { name: 'retailPriceLimit', width: 100,hidden:true,align:"right",sortable:false,
            	   formatter:function(cellvalue, options, row){
                       return formatAmount(cellvalue, options, row);
                   }
               }
           ],
           rowNum: 20,
           rowList: [10, 20, 50, 100],
           rownumbers: true,
           pager: "#gridpage",
           multiselect: false, 
           viewrecords: true,
           gridComplete: function(){
        	 //序号列宽度自适应（参数为jqgridID）
               autoRNWidth("gridlist");
           	//数据只有一条时默认选中（参数为jqgridID）
            // selectByOneData("gridlist");
           }, 
           caption: "<spring:message code="message.list.DingDanMingXiLieBiao"/>",
           jsonReader: {
               repeatitems: false,
               id: "orderId"
           }
       });
       $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
       $(window).trigger("resize");
       
       $("html").scrollTop(305);
   });
   
   function getFoucs(obj, rowId) {
	   var text = $.trim($(obj).val());
	   if (text != null && text != "") {
		   var $checkbox = $("#jqg_gridlist_" + rowId);
		   if ($checkbox.is(":not(:checked)")) {
			   $("#gridlist").setSelection(rowId);
		   }
	   }
   }
   
   //查询
   function gridSerch() {
       var drugCode = $.trim($("#drugCode").val());
       var drugName = $.trim($("#drugName").val());
       var prodComp = $.trim($("#prodComp").val());
       $("#gridlist").jqGrid('setGridParam',{  
           datatype:'json',
           postData:{
        	   "drugCode":drugCode,
               "drugName":drugName,
               "compName":prodComp
           },
           page:1
       }).trigger("reloadGrid"); //重新载入  
   }
 
   </script>
        
</body>
</html>
